﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mixture.Data;
using System.IO;
using Krile.Kernel;

namespace Mixture.Config
{
    public class Config
    {
        public static Config LoadConfig()
        {
            var t = Path.Combine(Bridge.Config.PluginPath, Define.ConfigFile);
            if (File.Exists(t))
            {
                try
                {
                    return Bridge.CommonOperation.XMLLoad<Config>(t);
                }
                catch (Exception e)
                {
                    Bridge.DebugReporter.AddReport(e);
                }
            }
            return new Config();
        }

        public void SaveConfig()
        {
            var t = Path.Combine(Bridge.Config.PluginPath, Define.ConfigFile);
            Bridge.CommonOperation.XMLSave<Config>(this, t);
        }

        public Account account = null;

        public bool EmbeddingImage = true;

        public int ReceiveInterval = 60;
    }
}
